﻿<style>
    .modal-lg { width: 70%; }
</style>

<div class="modal-header">
    <button type="button" class="close" ng-disabled="loadingState" ng-click="close();">
        <span aria-hidden="true">&times;</span>
    </button>
    <h3 class="modal-title">科目选择</h3>
</div>

<div class="modal-body">
    <table class="table responsive table-hover">
        <thead>
            <tr>
                <th style="width: 10%;" class="text-center">
                    <input type="checkbox" ng-click="checkAll();" title="全选" ng-disabled="loadingState" />
                </th>
                <th style="width: 40%;">科目名称</th>
                <th style="width: 15%;" class="text-center">应生成数</th>
                <th style="width: 15%;" class="text-center">已生成数</th>
                <th></th>
            </tr>
        </thead>
    </table>

    <div style="max-height: 280px; overflow-y: scroll;">
        <table class="table responsive table-hover">
            <tbody>
                <tr ng-repeat="item in list" ng-click="check(item);" style="cursor: pointer;">
                    <td style="width: 10%;" class="text-center">
                        <input type="checkbox" id="cbxSubject_{{item.examSubjectId}}" value="{{item.examSubjectId}}" ng-click="check(item);" ng-disabled="item.needCount==item.nowCount||loadingState" />
                    </td>
                    <td style="width: 40%;" title="{{item.examSubjectName}}">
                        {{item.examSubjectName | formatLongStr}}

                        <p ng-show="examMode==2" class="text-gray">
                            {{item.examSceneName}} ({{item.examScenePlanBeginTime | formatDate | date: 'yyyy-MM-dd HH:mm:ss'}})
                        </p>
                    </td>
                    <td style="width: 15%;" class="text-center">
                        <span ng-bind="item.needCount"></span>
                    </td>
                    <td style="width: 15%;" class="text-center">
                        <span ng-bind="item.nowCount"></span>
                    </td>
                    <td style="width: 20%;" class="text-center">
                        <button class="btn btn-turquoise btn-sm" ng-click="build(item);" ng-disabled="loadingState||item.needCount==item.nowCount" ng-hide="item.needCount==item.nowCount">
                            <i id="loading_{{item.examSubjectId}}" class="fa fa-spinner fa-spin" style="display:none;"></i>
                            生成
                        </button>
                        <span ng-show="item.needCount==item.nowCount" class="text-success">
                            <i class="fa fa-check"></i>
                            已生成
                        </span>
                        <button class="btn btn-gray btn-sm" ng-click="clean(item);" ng-disabled="loadingState" ng-hide="item.nowCount==0">
                            <i class="fa fa-close"></i>
                            清理
                        </button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>

<div class="modal-footer">
    <button class="btn btn-turquoise pull-left" ng-click="buildBatch();" ng-disabled="loadingState" ng-show="isBatch">
        <i ng-show="loadingBatch" class="fa fa-spinner fa-spin"></i>
        批量生成
    </button>
    <button class="btn btn-gray pull-right" ng-click="close();" ng-disabled="loadingState">
        <i class="fa fa-close"></i>
        关闭
    </button>
</div>
